The present invention relates, in general, to software engineering, and more particularly to testing of object oriented software.
According to the prior art, testing of software modules has taken place only on an individual module by module basis. When using structured software the basic unit is the function. Traditional tests of such software supply a set of inputs, execute the function, and examine the outputs to verify that correct results were obtained. Functions are assumed to maintain no state information that is used during subsequent executions. More recently use of object oriented programming methodologies has become common. The special requirements of object oriented programming are outlined in a paper entitled "What is Object oriented Programming?", by Bjarne Stoustrup, published May 1988 in IEEE Software, which is included herein by reference. Another explanation related to C++ is found on pages 127-200 of the "Turbo C++ User's Guide", Second Edition, published in 1991 by Borland International, Inc., which is included herein by reference.
For object-oriented software, structural testing is inadequate because the internal state of objects is not tested. The basic unit in object-oriented software is the class. Classes are tested by setting an initial state, executing one or more class operations, and verifying that the final state is correct. However, prior art practices only consider those data members defined in a class to be a part of the class' state. In actuality, the state of a class consists of data members defined within the class and those that are inherited. Therefore, prior art testing methods do not verify the complete state of an object.
There is a need for a method to test the complete state of an object within an object oriented program. The method should be easily automated and verify the state of all levels of the inheritance hierarchy. Ideally the method should minimize the effort required and allow the resultant object code to be unchanged as a result of the testing.